package com.tbit.uqbike.client.constant.enums;

/**
 * 财务api类型（支付/退款等）枚举
 *
 * @author <a href="mailto:zhang.zhiliang@tbit.com.cn">Zhang ZhiLiang</a>
 * @version 1.0
 * @see <a href="http://adsl1.tbit.com.cn:21490/pages/viewpage.action?pageId=82182491">订单号规范</a>
 * @since 2024/10/24
 */
public enum PayApiTypeEnum {

    /**
     * 微信支付v2调用
     */
    WECHAT_V2("wechat_v2"),
    /**
     * 微信支付服务商v3调用
     */
    WECHAT_MCH_V3("wechat_mch_v3")
    ;

  private final String apiType;

  PayApiTypeEnum(String apiType) {
    this.apiType = apiType;
  }

  public String getApiType() {
    return apiType;
  }

  public PayApiTypeEnum getPayApiTypeEnum(String apiType) {
      for (PayApiTypeEnum payApiTypeEnum : PayApiTypeEnum.values()) {
          if (payApiTypeEnum.getApiType().equals(apiType)) {
              return payApiTypeEnum;
          }
      }
      return null;
  }

}
